package com.zxj.controller;

import com.seventh.common.pojo.R;
import com.zxj.pojo.entity.TbCar;
import com.zxj.pojo.entity.TbCarComment;
import com.zxj.pojo.vo.CommentVo;
import com.zxj.pojo.vo.OperVo;
import com.zxj.service.CarCommentService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @program: clms-seventh
 * @description:
 * @author: 张修杰
 * @create: 2021-07-24 22:22
 **/
@RestController
@RequestMapping("lease/carComment")

public class CarCommentController {
    @Resource
    CarCommentService carCommentService;
    @ApiOperation(value = "初始化汽车查询信息")
    @PostMapping("initCarCommentTable/{currentpage}/{pagesize}")
    public R initCarCommentTable(@PathVariable("currentpage") Integer currentpage,
                          @PathVariable("pagesize") Integer pagesize,
                          @RequestBody CommentVo commentVo){
        return carCommentService.findAllCarCommentPage(currentpage,pagesize,commentVo);
    }
    @ApiOperation(value = "修改汽车信息")
    @PutMapping("updateCarCommentById")
    public R updateCarById(@RequestBody TbCarComment tbCarComment){
        return carCommentService.updateCarCommentById(tbCarComment);
    }

    @ApiOperation(value = "修改回显 汽车信息")
    @GetMapping("selectCarCommentById/{id}")
    public R selectCarCommentById(@PathVariable String id){
        return carCommentService.selectCarCommentById(id);
    }
    @ApiOperation(value = "新增汽车信息")
    @PutMapping("insertCarComment")
    public R insertCarComment(@RequestBody TbCarComment tbCarComment){
        return carCommentService.insertCarComment(tbCarComment);
    }
    @ApiOperation(value = "删除汽车信息")
    @GetMapping("deleteCarComment/{id}")
    public R deleteCarComment(@PathVariable String id){
        return carCommentService.deleteCarComment(id);
    }

}
